<template>
	<view>
		<jsQr @success='qrcodeSucess' @error="qrcodeError"></jsQr>
	</view>
</template>

<script>
	import VConsole from 'vconsole';
	import jsQr from '@/components/jsQr/jsQr.vue'
	const vconsole = new VConsole();
	export default {
		components: {
			jsQr
		},
		methods: {
			qrcodeSucess(data) {
				console.log(data,'qrcodeSucess成功');
				uni.showModal({
					title: '成功',
					content: data,
					success: () => {
						uni.navigateBack({})
					}
				})
			},
			qrcodeError(err) {
				console.log(err,'qrcodeError')
				uni.showModal({
					title: '摄像头授权失败',
					content: '摄像头授权失败，请检测当前浏览器是否有摄像头权限。',
					success: () => {
						uni.navigateBack({})
					}
				})
			}
		},
	}
</script>

<style>

</style>